Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding EIP Data Source support for Tags #3505

Merged
merged 7 commits into from
Nov 13, 2018

Conversation

vpadronblanco
Copy link
Contributor

Solves #3423

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Feb 23, 2018
@vpadronblanco
Copy link
Contributor Author

for the test I created, I have a failure. Don't know what the convention is to create acceptance tests for data sources. But from what I found I only need to make the implicit dependency on the data source so that it creates the resource first and then looks for it. But seems to be not finding it. Any pointers?

Output:
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccDataSourceAwsEip_tags -timeout 120m
=== RUN TestAccDataSourceAwsEip_tags
--- FAIL: TestAccDataSourceAwsEip_tags (9.75s)
testing.go:513: Step 0 error: Error applying: 1 error(s) occurred:

	* data.aws_eip.by_tag: data.aws_eip.by_tag: no matching Elastic IP found
testing.go:573: Error destroying resource! WARNING: Dangling resources
	may exist. The full state and error is shown below.
	
	Error: Error refreshing: 1 error(s) occurred:
	
	* data.aws_eip.by_tag: 1 error(s) occurred:
	
	* data.aws_eip.by_tag: data.aws_eip.by_tag: no matching Elastic IP found
	
	State: <nil>

FAIL
exit status 1

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Feb 24, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Feb 28, 2018
@vpadronblanco vpadronblanco changed the title [WIP] Adding EIP Data Source support for Tags Adding EIP Data Source support for Tags Mar 5, 2018
@vpadronblanco
Copy link
Contributor Author

As stated in PR#3525, the Terraform bug was not known to me. Adding an explicit depends_on for the data source was necessary for the template to run; but this caused issues when refreshing the state. To solve this, just an implicit dependency on a computed value was necessary to work around it.

Test result:

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccDataSourceAwsEip_tags -timeout 120m
=== RUN TestAccDataSourceAwsEip_tags
--- PASS: TestAccDataSourceAwsEip_tags (21.00s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 21.032s

@kallon
Copy link

kallon commented Oct 3, 2018

Hi, is it possible to merge this PR? We would like to use this functionality

@bflad bflad added this to the v1.45.0 milestone Nov 7, 2018
@bflad bflad merged commit b28556e into hashicorp:master Nov 13, 2018
bflad added a commit that referenced this pull request Nov 13, 2018
```
--- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (8.56s)
--- PASS: TestAccDataSourceAwsEip_PublicIP_VPC (11.76s)
--- PASS: TestAccDataSourceAwsEip_Id (11.79s)
--- PASS: TestAccDataSourceAwsEip_Tags (12.45s)
--- PASS: TestAccDataSourceAwsEip_Filter (12.58s)
```
@bflad bflad modified the milestones: v1.45.0, v1.44.0 Nov 13, 2018
@bflad bflad mentioned this pull request Nov 13, 2018
bflad added a commit that referenced this pull request Nov 13, 2018
@bflad
Copy link
Contributor

bflad commented Nov 15, 2018

This has been released in version 1.44.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants